/*
using MyGeneration/Template/NHibernate (c) by lujan99@usa.net
*/
using System;
using System.Collections;
using System.Collections.Generic;

namespace OpenGado.DATA.Entities
{
	/// <summary>
	/// Product object for NHibernate mapped table 'product'.
	/// </summary>
	[Serializable]
	public class Product
	{
		#region Member Variables
		protected int _productid;
		protected string _batchnumber;
		protected string _productname;
		protected string _productdescription;
		protected string _sku;
		protected decimal? _productquantity;
		protected decimal? _productreorderlevel;
		protected decimal? _productreorderquantity;
		protected int? _productexpires;
		protected DateTime? _productexpiry;
		protected string _manufacturer;
		protected string _manufacturercode;
		protected Categories _categories;
		protected decimal? _currentprice;
		protected Vendor _vendor;
		protected UnitOfMeasure _unitofmeasure;
		protected string _productnotes;
		protected Storage _storage;
		protected Project _project;
		protected IList<IssueItem> _issueitem;
		protected IList<ProductPriceHistory> _productpricehistory;
		protected IList<PurchaseOrderItems> _purchaseorderitems;
		protected IList<RequestItem> _requestitem;
		#endregion
		#region Constructors
			
		public Product() {}
					
		public Product(string batchnumber, string productname, string productdescription, string sku, decimal? productquantity, decimal? productreorderlevel, decimal? productreorderquantity, int? productexpires, DateTime? productexpiry, string manufacturer, string manufacturercode, Categories categories, decimal? currentprice, UnitOfMeasure unitofmeasure, string productnotes, Storage storage, Project project) 
		{
			this._batchnumber= batchnumber;
			this._productname= productname;
			this._productdescription= productdescription;
			this._sku= sku;
			this._productquantity= productquantity;
			this._productreorderlevel= productreorderlevel;
			this._productreorderquantity= productreorderquantity;
			this._productexpires= productexpires;
			this._productexpiry= productexpiry;
			this._manufacturer= manufacturer;
			this._manufacturercode= manufacturercode;
			this._categories= categories;
			this._currentprice= currentprice;
			this._unitofmeasure= unitofmeasure;
			this._productnotes= productnotes;
			this._storage= storage;
			this._project= project;
		}

		public Product(Categories categories, UnitOfMeasure unitofmeasure, Storage storage, Project project)
		{
			this._categories= categories;
			this._unitofmeasure= unitofmeasure;
			this._storage= storage;
			this._project= project;
		}
		
		#endregion
		#region Public Properties
		public int Productid
		{
			get { return _productid; }
			set {_productid= value; }
		}
		public string BatchNumber
		{
			get { return _batchnumber; }
			set {_batchnumber= value; }
		}
		public string ProductName
		{
			get { return _productname; }
			set {_productname= value; }
		}
		public string ProductDescription
		{
			get { return _productdescription; }
			set {_productdescription= value; }
		}
		public string Sku
		{
			get { return _sku; }
			set {_sku= value; }
		}
		public decimal? ProductQuantity
		{
			get { return _productquantity; }
			set {_productquantity= value; }
		}
		public decimal? ProductReorderLevel
		{
			get { return _productreorderlevel; }
			set {_productreorderlevel= value; }
		}
		public decimal? ProductReorderQuantity
		{
			get { return _productreorderquantity; }
			set {_productreorderquantity= value; }
		}
		public int? ProductExpires
		{
			get { return _productexpires; }
			set {_productexpires= value; }
		}
		public DateTime? ProductExpiry
		{
			get { return _productexpiry; }
			set {_productexpiry= value; }
		}
		public string Manufacturer
		{
			get { return _manufacturer; }
			set {_manufacturer= value; }
		}
		public string ManufacturerCode
		{
			get { return _manufacturercode; }
			set {_manufacturercode= value; }
		}
		public Categories Categories
		{
			get { return _categories; }
			set {_categories= value; }
		}
		public decimal? CurrentPrice
		{
			get { return _currentprice; }
			set {_currentprice= value; }
		}
		public Vendor Vendor
		{
			get { return _vendor; }
			set {_vendor= value; }
		}
		public UnitOfMeasure UnitOfMeasure
		{
			get { return _unitofmeasure; }
			set {_unitofmeasure= value; }
		}
		public string ProductNotes
		{
			get { return _productnotes; }
			set {_productnotes= value; }
		}
		public Storage Storage
		{
			get { return _storage; }
			set {_storage= value; }
		}
		public Project Project
		{
			get { return _project; }
			set {_project= value; }
		}
		public IList<IssueItem> IssueItem
		{
			get { return _issueitem; }
			set {_issueitem= value; }
		}
		public IList<ProductPriceHistory> ProductPriceHistory
		{
			get { return _productpricehistory; }
			set {_productpricehistory= value; }
		}
		public IList<PurchaseOrderItems> PurchaseOrderItems
		{
			get { return _purchaseorderitems; }
			set {_purchaseorderitems= value; }
		}
		public IList<RequestItem> RequestItem
		{
			get { return _requestitem; }
			set {_requestitem= value; }
		}
		#endregion
		
		#region Equals And HashCode Overrides
		/// <summary>
		/// local implementation of Equals based on unique value members
		/// </summary>
		public override bool Equals( object obj )
		{
			if( this == obj ) return true;
			if( ( obj == null ) || ( obj.GetType() != this.GetType() ) ) return false;
			Product castObj = (Product)obj;
			return ( castObj != null ) &&
			this._productid == castObj.Productid;
		}
		/// <summary>
		/// local implementation of GetHashCode based on unique value members
		/// </summary>
		public override int GetHashCode()
		{
			int hash = 57;
			hash = 27 * hash * _productid.GetHashCode();
			return hash;
		}
		#endregion
		
	}
}
